home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
bbs
/
cddk9606.zip
/
HEADERS.ARJ
/
SOUNDS.INT
< prev
next >
Wrap
Text File
|
1996-06-14
|
3KB
|
81 lines
{ ───────────────────────────────────────────────────────────────────────── }
{ SOUNDS: PC-Speaker routines }
{ Copyright 1996 David Pinch ∙ All Rights Reserved Worldwide }
{ ───────────────────────────────────────────────────────────────────────── }
UNIT Sounds;
{$B-} { . . . . . . . . . . . . . . . . . . . . Shortcut boolean evaluation }
{$F+} { . . . . . . . . . . . . . . . . . . . . Force far calls for safety }
{$I-} { . . . . . . . . . . . . . . . . . . . Disable input/output checking }
{$O+} { . . . . . . . . . . . . . . . . . . Allow this unit to be overlayed }
{$Q-} { . . . . . . . . . . . . . . Do not generate overflow-checking code }
{$R-} { . . . . . . . . . . . . . . . . Do not generate range-checking code }
{$S-} { . . . . . . . . . . . . . . . . Do not generate stack-checking code }
{$X+} { . . . . . . . . . . . Extended syntax for pChars and function calls }
INTERFACE
{#Start}
PROCEDURE Ring;
{
PURPOSE : Simulates a telephone ring on the local computer.
SEE ALSO : Siren
}
PROCEDURE Siren(Resolution,Amplitude,Midline,DelayFactor,Count:Word);
{
PURPOSE : Generates a cosine siren on the local computer.
NOTES : A cosine curve looks something like this:
1 ∙ . . ∙
│ ∙ ∙
│ ∙ ∙
│ ∙ ∙
0 ──┼───────────────────────────────────────
│ ∙ ∙
│ ∙ ∙
│ ∙ ∙
-1 │ ∙ . ∙
0 π/2 π 3π/2 2π
Notice that the cosine graph repeats one full cycle every
2π (6.28) units. This is the basis for many different sirens.
The sound at any given point is calculated from this curve.
PARAMS : Resolution The cosine curve is divided into a large number
of steps. The siren cycles through each step and
creates a sound based on the curve at that step.
The number of steps is the resolution of the siren.
Amplitude Each step is multiplied by the amplitude. Since
the peaks of the curve have a maximum value of +1
and a minimum value of -1, this generates an
effective range of -Amplitude to +Amplitude.
Midline The middle frequency (i.e. the line through the
middle of the curve). The final range of the
siren is Midline-Amplitude to Midline+Amplitude.
Delay This parameter allows you to tweak the speed of
the siren, which is dependent of the clock speed
of the CPU. Adjust this factor if the siren
sounds bad.
Count The number of times to repeat the siren.
SEE ALSO : Ring
}
IMPLEMENTATION
{ The source code is available upon registration. }
END.